package org.bbmall.bean.member;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 会员核心指标实体类
 * 对应数据库表：ads_member_core_metrics
 */
@Data
@TableName("ads_member_core_metrics")
public class AdsMemberCoreMetrics {

    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 统计日期
     */
    @TableField("stat_date")
    private LocalDate statDate;

    /**
     * 会员总数
     */
    @TableField("total_members")
    private Integer totalMembers;

    /**
     * 活跃会员数
     */
    @TableField("active_members")
    private Integer activeMembers;

    /**
     * 活跃度
     */
    @TableField("activity_rate")
    private BigDecimal activityRate;

    /**
     * 会员平均消费金额
     */
    @TableField("avg_consumption")
    private BigDecimal avgConsumption;

    /**
     * 会员复购率
     */
    @TableField("repurchase_rate")
    private BigDecimal repurchaseRate;

    /**
     * 新会员转化率
     */
    @TableField("new_member_conversion_rate")
    private BigDecimal newMemberConversionRate;

    /**
     * 会员总数环比
     */
    @TableField("total_members_change")
    private BigDecimal totalMembersChange;

    /**
     * 活跃会员环比
     */
    @TableField("active_members_change")
    private BigDecimal activeMembersChange;

    /**
     * 平均消费环比
     */
    @TableField("avg_consumption_change")
    private BigDecimal avgConsumptionChange;

    /**
     * 复购率环比
     */
    @TableField("repurchase_rate_change")
    private BigDecimal repurchaseRateChange;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}